package com.fei.controller;

import com.fei.bean.SongListBean;
import com.fei.service.SongListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class SongListController {

    @Autowired
    SongListService songListService;

    @RequestMapping("/user/ajax/genres")
    public String toGenres(String type, Model model){
        List<SongListBean> songListBean = songListService.findAllOrSelectOneTypeService(type);
        model.addAttribute("songListBeanList",songListBean);
        model.addAttribute("type",type);
        return "genres::genres";
    }

}
